home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacPerl 5.0.3 / MacPerl Source ƒ / MacPerl5 / pod / modpods / AnyDBMFile.pod < prev    next >
Encoding:
Text File  |  1994-12-26  |  2.1 KB  |  74 lines  |  [TEXT/MPS ]

  1. =head1 NAME
  2.  
  3. AnyDBM_File - provide framework for multiple DBMs
  4.  
  5. NDBM_File, ODBM_File, SDBM_File, GDBM_File - various DBM implementations
  6.  
  7. =head1 SYNOPSIS
  8.  
  9.     use AnyDBM_File;
  10.  
  11. =head1 DESCRIPTION
  12.  
  13. This module is a "pure virtual base class"--it has nothing of us its own.
  14. It's just there to inherit from one of the various DBM packages.  It
  15. prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
  16. L<DB_File>), GDBM, SDBM (which is always there -- it comes with Perl), and
  17. finally ODBM.   This way old programs that used to use NDBM via dbmopen() can still 
  18. do so, but new ones can reorder @ISA:
  19.  
  20.     @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
  21.  
  22. This makes it trivial to copy database formats:
  23.  
  24.     use POSIX; use NDBM_File; use DB_File;
  25.     tie %newhash,  DB_File, $new_filename, O_CREAT|O_RDWR;
  26.     tie %oldhash,  NDBM_File, $old_filename, 1, 0;
  27.     %newhash = %oldhash;
  28.  
  29. =head2 DBM Comparisons
  30.  
  31. Here's a partial table of features the different packages offer:
  32.  
  33.                          odbm    ndbm    sdbm    gdbm    bsd-db
  34.              ----     ----    ----    ----    ------
  35.  Linkage comes w/ perl   yes     yes     yes     yes     yes
  36.  Src comes w/ perl       no      no      yes     no      no
  37.  Comes w/ many unix os   yes     yes[0]  no      no      no
  38.  Builds ok on !unix      ?       ?       yes     yes     ?
  39.  Code Size               ?       ?       small   big     big
  40.  Database Size           ?       ?       small   big?    ok[1]
  41.  Speed                   ?       ?       slow    ok      fast
  42.  FTPable                 no      no      yes     yes     yes
  43.  Easy to build          N/A     N/A      yes     yes     ok[2]
  44.  Size limits             1k      4k      1k[3]   none    none
  45.  Byte-order independent  no      no      no      no      yes
  46.  Licensing restrictions  ?       ?       no      yes     no
  47.  
  48.  
  49. =over 4
  50.  
  51. =item [0] 
  52.  
  53. on mixed universe machines, may be in the bsd compat library,
  54. which is often shunned.
  55.  
  56. =item [1] 
  57.  
  58. Can be trimmed if you compile for one access method.
  59.  
  60. =item [2] 
  61.  
  62. See L<DB_File>. 
  63. Requires symbolic links.  
  64.  
  65. =item [3] 
  66.  
  67. By default, but can be redefined.
  68.  
  69. =back
  70.  
  71. =head1 SEE ALSO
  72.  
  73. dbm(3), ndbm(3), DB_File(3)
  74.